package Char_stream_package;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Char_stream_demo2 {
    public static void main(String[] args) throws IOException {
        /*
            字节流拷贝中文不会出现乱码
         */

        //1、创建对象
        FileInputStream fis = new FileInputStream("/Users/zhaoxiaoyong/Documents/Java" +
                "/IO_stream_project/Char_stream_module/src/rough_draft/a.txt");
        FileOutputStream fos = new FileOutputStream("/Users/zhaoxiaoyong/Documents/Java" +
                "/IO_stream_project/Char_stream_module/src/rough_draft/b.txt");

        //2、拷贝
        int b;
        while ((b = fis.read()) != -1) {
            fos.write(b);
        }

        //3、释放资源
        fos.close();
        fis.close();
    }
}
